package creational.singleton;

/**
 * 饿汉式单例，采用了空间换时间的方式，在类加载的时候就构建了单例
 */
public class EagerSingleton {

    private static EagerSingleton singleton = new EagerSingleton();

    private EagerSingleton() {

    }

    public static EagerSingleton getInstance() {
        return singleton;
    }
}
